package com.ymatou.iapi.godmch.service;

import org.json.JSONException;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*获取装修授权tokenCall
*FreeMaker Template自动生成代码
*/
public class getAuthTokenCall extends YmatouBaseCall{
	private static String opurl ="api/designauth/getAuthToken";
	
	public getAuthTokenCall() {
		super(EnvSetup.getSystemUrl("godmch_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public String getCode() {
		return getString("status");
	}
	public String getMsg() {
		return getString("Msg");
	}
	
	public String getResult() throws JSONException {
		return new JSONObject(this.getReturnData()).getJSONObject("result").getString("accessToken");
	}
}